package com.ygqh.baby.model.ngmm;

import java.util.ArrayList;
import java.util.List;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.annotation.JSONField;

public class NgmmOrderInfoResult extends NgmmResult {

	@JSONField(name = "data")
	private Object extra;
	
	private List<NgmmOrder> orders;

	public List<NgmmOrder> getOrders() {
		return orders;
	}

	public void setExtra(Object extra) {
		this.extra = extra;
		orders = new ArrayList<NgmmOrder>();
		if (extra != null) {
			String extraStr = JSONObject.toJSONString(extra);
			if (extra instanceof JSONObject) {
				orders.add(JSONObject.parseObject(extraStr, NgmmOrder.class));
			} else if (extra instanceof JSONArray) {
				orders = JSONArray.parseArray(JSONObject.toJSONString(extra), NgmmOrder.class);
			}
		}
	}

	@Override
	public String toString() {
		return "NgmmOrderInfoResult [extra=" + extra + "]";
	}
	
}
